home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / windows / epmpal.zip / EPMPAL.CMD next >
OS/2 REXX Batch file  |  1997-05-26  |  2KB  |  64 lines

  1. /* í«í¿¬ßß */
  2.  call rxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  3.  call SysLoadFuncs
  4.  
  5.  '@echo off'
  6.  patchmod = 'etke603.dll';
  7.  palfname = 'vp.pal';
  8.  signature = 'GpiCreatePS failed';
  9.  
  10.  say 'This program requires lxLite to be on your path.'
  11.  say 'Second requirement is that 'patchmod' must be present'
  12.  say 'in current directory. If any of these requirements are'
  13.  say 'not meet, press Ctrl+C and fix the situation.'
  14.  call charout ,'Press any key to continue...'
  15.  call SysGetKey "noecho"
  16.  call charout ,d2c(13);
  17.  
  18.  call SysFileDelete(palfname);
  19.  'start /fs /dos /c vp.com /m /s /w'
  20.  call charout ,'Waiting for palette file, press Ctrl+C to interrupt ';
  21.  do until stream(palfname, 'C', 'QUERY EXIST') <> ''
  22.   call charout ,'.';
  23.   call SysSleep 1;
  24.  end;
  25.  say '';
  26.  
  27. /* Read palette converting it from RGB format into BGR0 */
  28.  pal = '';
  29.  do i = 1 to 16
  30.   tmp = charin(palfname,,3);
  31.   do j = 3 to 1 by -1
  32.    pal = pal||d2c(c2d(substr(tmp, j, 1)) * 4 + 3);
  33.   end;
  34.   pal = pal||d2c(0);
  35.  end;
  36.  
  37.  'lxLite /x 'patchmod;
  38.  if (rc <> 0)
  39.   then do
  40.         say 'lxLite failed to unpack 'patchmod
  41.         say 'Please check that you'
  42.         say 'a) Have lxLite on your PATH'
  43.         say 'b) Have 'patchmod' in current directory'
  44.         exit;
  45.        end;
  46.  
  47.  say 'Applying palette to 'patchmod'...';
  48.  len = chars(patchmod);
  49.  mod = charin(patchmod,,len);
  50.  pp = pos(signature, mod);
  51.  if pp = 0
  52.   then do
  53.         say 'Signature not found - seems that you have a different EPM version'
  54.         exit;
  55.        end;
  56.  mod = overlay(pal, mod, pp - length(pal));
  57.  call stream patchmod, 'C', 'CLOSE';
  58.  'del 'patchmod
  59.  call charout patchmod, mod
  60.  call stream patchmod, 'C', 'CLOSE';
  61.  
  62.  'lxLite 'patchmod;
  63.  say 'Palette applied successfully'
  64.